/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author YDZ
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';
import { TreeDataModel } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface BasVen extends BasicModel<BasVen> {
  pkCubasdoc?: string; // 客商档案主键
  pkAreacl?: string; // 地区分类
  pkCorp?: string; // 公司主键
  custcode?: string; // 客商编码
  custname?: string; // 客商名称
  custshortname?: string; // 客商简称
}

export const basVenList = (params?: BasVen | any) =>
  defHttp.get<BasVen>({ url: adminPath + '/bas/ven/basVen/list', params });

export const basVenListData = (params?: BasVen | any) =>
  defHttp.post<Page<BasVen>>({ url: adminPath + '/bas/ven/basVen/listData', params });

export const basVenForm = (params?: BasVen | any) =>
  defHttp.get<BasVen>({ url: adminPath + '/bas/ven/basVen/form', params });

export const basVenSave = (params?: any, data?: BasVen | any) =>
  defHttp.postJson<BasVen>({ url: adminPath + '/bas/ven/basVen/save', params, data });

export const basVenDisable = (params?: BasVen | any) =>
  defHttp.get<BasVen>({ url: adminPath + '/bas/ven/basVen/disable', params });

export const basVenEnable = (params?: BasVen | any) =>
  defHttp.get<BasVen>({ url: adminPath + '/bas/ven/basVen/enable', params });

export const basVenDelete = (params?: BasVen | any) =>
  defHttp.get<BasVen>({ url: adminPath + '/bas/ven/basVen/delete', params });

export const basVenTreeData = (params?: any) =>
  defHttp.get<TreeDataModel[]>({ url: adminPath + '/bas/ven/basVen/treeData', params });
